var strFullPath=window.document.location.href;
var strPath=window.document.location.pathname;
var pos=strFullPath.indexOf(strPath);
var prePath=strFullPath.substring(0,pos);
var project = window.location.pathname.split("/")[1];
var url = prePath+"/"+project+"/TeacherController/addRemark.wm";
$(function () {
    $("#toptitle").html("学生详细信息");
    $(".king-btn-demo").click(function () {
        window.history.back(-1);
    });
   $(".king-btn-demo1").click(function () {
       var remarks = $("#remark").val();
       var student_id = $("#hidden").val();
       var class_id = $("#class_id").val();
       if(remarks==""){
           alert("备注为空！");
       }else{
           $.post(url,{remarks:remarks,
           student_id:student_id},function (result) {
               if(result.msg=="yes"){
                   alert("添加备注成功！");
                   self.location=document.referrer;//返回到上一页并刷新
                   //self.opener.location.reload();
               }else{
                   alert("系统错误！添加失败!")
               }
           },"json");
       }
   });
});